<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
        let drugId = window.location.href.split("?")[1].split("=")[1];
        console.log(drugId);
        $(function () {
            $('#backid').click(function(){
                    window.location.href="index.html";
            });
            console.log("aaa");
            $.ajax({
                url:"queryDrugById",
                data:{"drugId":drugId},
                type: "get",
                dataType: "json",
                success:function (data) {
                    console.log(drugId);
                    let code = data.code;
                    if (code==200){
                        console.log(code);
                        let drug = data.data.drug;
                        $("#drugId").text(drugId);
                        $("#inPrice").text(drug.drInprice);
                        $("#outPrice").text(drug.drOutprice);
                        $("#drugName").text(drug.drName);
                        $("#drugType").text(drug.drType);
                        $("#drugSimDesc").text(drug.drSimdesc);
                        $("#drugQGP").text(drug.drQgp);
                        $("#drugDetaDesc").text(drug.drDetadesc);
                        $("#drugFactory").text(drug.drFatory);
                        $("#drugDirection").text(drug.drDirection);
                        $("#drugNumber").text(drug.drNumber);
                        $("#drugRemark").text(drug.drRemark);
                    }else {
                        alert("查询失败！请返回")
                    }
                }
            })
        });


    </script>
</head>
<body>
<form action="../../index.html" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">药品编号</td>
        <td id="drugId">J6764</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">图片</td>
        <td><img id="imgUrl" src="1.png"/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">进价</td>
        <td id="inPrice">2元</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">售价</td>
        <td id="outPrice">128.9元</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">药品名称</td>
        <td id="drugName">感冒药</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">药品类型</td>
        <td id="drugType">处方药</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">简单描述</td>
        <td id="drugSimDesc">用于普通感冒</td>
    </tr>

    <tr>
        <td width="10%" class="tableleft">保质期</td>
        <td id="drugQGP">2016年01月01日</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">详细描述</td>
        <td id="drugDetaDesc">该药仅用于普通的流行性感冒,孕妇小孩慬用……</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">生产厂商</td>
        <td id="drugFactory">哈药六厂生产</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">服用说明</td>
        <td id="drugDirection">一次两粒一日三次</td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">剩余量</td>
        <td id="drugNumber">1000袋</td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td id="drugRemark">暂无服用后不良记录</td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
			</center>
		</td>
    </tr>
</table>
</form>
</body>
</html>